home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- global proc int objFileOptions ( string $parent, string $action,
- string $initialSettings, string $resultCallback )
- //
- // Description:
- // This script posts the obj file accessor options.
- //
- // Parameters:
- // $parent - the elf parent layout for this options layout. It is
- // always a scrollLayout.
- // $action - the action that is to be performed with this invokation
- // of this proc. Valid options are:
- // "query" - construct the options string and pass it
- // to the resultCallback.
- // "post" - post all the elf controls.
- // $resultCallback -
- // This is the proc to be called with the result string.
- // resultCallback ( string $optionsString )
- //
- // Returns:
- // 1 if successfull.
- // 0 otherwise.
- //
- {
- int $result;
- string $currentOptions;
- string $optionList[];
- string $optionBreakDown[];
- int $index;
-
- if ($action == "post") {
- setUITemplate -pushTemplate DefaultTemplate;
- setParent $parent;
-
- columnLayout -adj true objMultiObjCol;
- radioButtonGrp
- -l "Create Multiple Objects"
- -nrb 2 -cw3 175 75 75
- -la2 "True" "False"
- -sl 1
- objMultiObjGrp;
-
- // Now set to current settings.
- $currentOptions = $initialSettings;
- if (size($currentOptions) > 0) {
- tokenize($currentOptions, ";", $optionList);
- for ($index = 0; $index < size($optionList); $index++) {
- tokenize($optionList[$index], "=", $optionBreakDown);
- if ($optionBreakDown[0] == "mo") {
- if ($optionBreakDown[1] == "0") {
- radioButtonGrp -e -sl 2 objMultiObjGrp;
- } else {
- radioButtonGrp -e -sl 1 objMultiObjGrp;
- }
- }
- }
- }
- setUITemplate -popTemplate;
- $result = 1;
-
- } else if ($action == "query") {
- // Set MultiObj option
- if (`radioButtonGrp -q -sl objMultiObjGrp` == 1) {
- $currentOptions = $currentOptions + "mo=1";
- } else {
- $currentOptions = $currentOptions + "mo=0";
- }
- eval($resultCallback+" \""+$currentOptions+"\"");
- $result = 1;
- } else {
- $result = 0;
- }
-
- return $result;
- }
-